﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using System.Data.SqlClient;
using IQKS.AWP.BusinessObject;

namespace IQKS.AWP.DataAccessLayer
{
    public class BriefMasterDAL
    {
        public DataSet GetBriefMaster(params object[] param)
        {
            DataSet objDs;

            try
            {
                objDs = DataUtils.ExecuteDataset("Usp_GetBriefMaster", param);

            }
            catch (Exception exception)
            {
                throw new ApplicationException(exception.Message);
            }
            return objDs;
        }


        public object SetBriefMaster(BriefMasterBO param)
        {
            try
            {

                SqlParameter[] parameters = new SqlParameter[]
			{
                new SqlParameter("@SetMethod",param.SetMethod),
                new SqlParameter("@CountryID",param.CountryID),
                new SqlParameter("@BriefID",param.BriefID),
                new SqlParameter("@BriefDocumentID",param.BriefDocumentID),
                new SqlParameter("@BriefTitle",param.BriefTitle),
                new SqlParameter("@BriefDesc",param.BriefDesc),
                new SqlParameter("@BriefStatus",param.BriefStatus),
                new SqlParameter("@BriefStartDate",param.StBriefStartDate),
                new SqlParameter("@BriefEndDate",param.StBriefEndDate),
                new SqlParameter("@DocumentName",param.DocumentName),
                new SqlParameter("@GDDocumentName",param.GDDocumentName),
                new SqlParameter("@DocumentPath",param.DocumentPath),
                new SqlParameter("@CreatedBy",param.CreatedBy),
                new SqlParameter("@ModifyBy",param.ModifyBy),
                new SqlParameter("@ModifyDate",param.ModifyDate),
                new SqlParameter("@IsActive",param.IsActive),
               
              
			};
                return DataUtils.ExecuteScalar("Usp_SetBriefMaster", parameters);
            }
            catch (Exception ex)
            {
                throw new ApplicationException(ex.Message);
            }
        }


        public string SetBriefMasterClearBrief(int intBriefID,Guid UserId)
        {
            try
            {
                string SetMethod = "SUCCESS";
                SqlParameter[] parameters= new SqlParameter[]
                {  
                    new SqlParameter("@SetMethod",SetMethod),
                    new SqlParameter("@BreifID",intBriefID),
                    new SqlParameter("@UserID",UserId)
              
			     };
                return (string)DataUtils.ExecuteScalar("USP_UpdateCandidateOnBreifDeleteAll", parameters);
            }
        
            catch (Exception ex)
            {
                throw new ApplicationException(ex.Message);
            }
        }
    }
}
